package com.ibm.risk.irmp.workflow.client.flowable.api;

import com.ibm.risk.irmp.workflow.client.flowable.ApiClient;

import com.ibm.risk.irmp.workflow.client.flowable.model.DataResponseJobResponse;
import com.ibm.risk.irmp.workflow.client.flowable.model.JobResponse;
import java.time.OffsetDateTime;
import com.ibm.risk.irmp.workflow.client.flowable.model.RestActionRequest;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;


@Component("com.ibm.risk.irmp.flowable.api.JobsApi")
public class JobsApi {
    private ApiClient apiClient;

    public JobsApi() {
        this(new ApiClient());
    }

    @Autowired
    public JobsApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Delete a deadletter job
     *
     * <p><b>204</b> - Indicates the job was found and has been deleted. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found.
     * @param jobId The jobId parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteDeadLetterJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling deleteDeadLetterJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/deadletter-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Delete a job
     *
     * <p><b>204</b> - Indicates the job was found and has been deleted. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found..
     * @param jobId The jobId parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling deleteJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Delete a suspended job
     *
     * <p><b>204</b> - Indicates the job was found and has been deleted. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found.
     * @param jobId The jobId parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteSuspendedJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling deleteSuspendedJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/suspended-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Delete a timer job
     *
     * <p><b>204</b> - Indicates the job was found and has been deleted. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found.
     * @param jobId The jobId parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteTimerJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling deleteTimerJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/timer-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Move a single deadletter job
     *
     * <p><b>204</b> - Indicates the dead letter job was moved. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found.
     * <p><b>500</b> - Indicates the an exception occurred while executing the job. The status-description contains additional detail about the error. The full error-stacktrace can be fetched later on if needed.
     * @param jobId The jobId parameter
     * @param body The body parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void executeDeadLetterJobAction(String jobId, RestActionRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling executeDeadLetterJobAction");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/deadletter-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Execute a single job
     *
     * <p><b>204</b> - Indicates the job was executed. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found.
     * <p><b>500</b> - Indicates the an exception occurred while executing the job. The status-description contains additional detail about the error. The full error-stacktrace can be fetched later on if needed.
     * @param jobId The jobId parameter
     * @param body The body parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void executeJobAction(String jobId, RestActionRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling executeJobAction");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Move a single timer job
     *
     * <p><b>204</b> - Indicates the timer job was moved. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested job was not found.
     * <p><b>500</b> - Indicates the an exception occurred while executing the job. The status-description contains additional detail about the error. The full error-stacktrace can be fetched later on if needed.
     * @param jobId The jobId parameter
     * @param body The body parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void executeTimerJobAction(String jobId, RestActionRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling executeTimerJobAction");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/timer-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get the exception stacktrace for a deadletter job
     *
     * <p><b>200</b> - Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain.
     * <p><b>404</b> - Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.
     * @param jobId The jobId parameter
     * @return String
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public String getDeadLetterJobStacktrace(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getDeadLetterJobStacktrace");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/deadletter-jobs/{jobId}/exception-stacktrace").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a single deadletter job
     *
     * <p><b>200</b> - Indicates the suspended job exists and is returned.
     * <p><b>404</b> - Indicates the requested job does not exist.
     * @param jobId The jobId parameter
     * @return JobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public JobResponse getDeadletterJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getDeadletterJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/deadletter-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<JobResponse> returnType = new ParameterizedTypeReference<JobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a single job
     *
     * <p><b>200</b> - Indicates the job exists and is returned.
     * <p><b>404</b> - Indicates the requested job does not exist.
     * @param jobId The jobId parameter
     * @return JobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public JobResponse getJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<JobResponse> returnType = new ParameterizedTypeReference<JobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get the exception stacktrace for a job
     *
     * <p><b>200</b> - Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain.
     * <p><b>404</b> - Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.
     * @param jobId The jobId parameter
     * @return String
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public String getJobStacktrace(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getJobStacktrace");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/jobs/{jobId}/exception-stacktrace").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a single suspended job
     *
     * <p><b>200</b> - Indicates the suspended job exists and is returned.
     * <p><b>404</b> - Indicates the requested job does not exist.
     * @param jobId The jobId parameter
     * @return JobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public JobResponse getSuspendedJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getSuspendedJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/suspended-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<JobResponse> returnType = new ParameterizedTypeReference<JobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get the exception stacktrace for a suspended job
     *
     * <p><b>200</b> - Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain.
     * <p><b>404</b> - Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.
     * @param jobId The jobId parameter
     * @return String
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public String getSuspendedJobStacktrace(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getSuspendedJobStacktrace");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/suspended-jobs/{jobId}/exception-stacktrace").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a single timer job
     *
     * <p><b>200</b> - Indicates the timer job exists and is returned.
     * <p><b>404</b> - Indicates the requested job does not exist.
     * @param jobId The jobId parameter
     * @return JobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public JobResponse getTimerJob(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getTimerJob");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/timer-jobs/{jobId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<JobResponse> returnType = new ParameterizedTypeReference<JobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get the exception stacktrace for a timer job
     *
     * <p><b>200</b> - Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain.
     * <p><b>404</b> - Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.
     * @param jobId The jobId parameter
     * @return String
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public String getTimerJobStacktrace(String jobId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'jobId' is set
        if (jobId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'jobId' when calling getTimerJobStacktrace");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("jobId", jobId);
        String path = UriComponentsBuilder.fromPath("/management/timer-jobs/{jobId}/exception-stacktrace").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List deadletter jobs
     *
     * <p><b>200</b> - Indicates the requested jobs were returned.
     * <p><b>400</b> - Indicates an illegal value has been used in a url query parameter or the both &#39;messagesOnly&#39; and &#39;timersOnly&#39; are used as parameters. Status description contains additional details about the error.
     * @param id Only return job with the given id
     * @param processInstanceId Only return jobs part of a process with the given id
     * @param executionId Only return jobs part of an execution with the given id
     * @param processDefinitionId Only return jobs with the given process definition id
     * @param elementId Only return jobs with the given element id
     * @param elementName Only return jobs with the given element name
     * @param executable If true, only return jobs which are executable. If false, this parameter is ignored.
     * @param timersOnly If true, only return jobs which are timers. If false, this parameter is ignored. Cannot be used together with &#39;messagesOnly&#39;.
     * @param messagesOnly If true, only return jobs which are messages. If false, this parameter is ignored. Cannot be used together with &#39;timersOnly&#39;
     * @param withException If true, only return jobs for which an exception occurred while executing it. If false, this parameter is ignored.
     * @param dueBefore Only return jobs which are due to be executed before the given date. Jobs without duedate are never returned using this parameter.
     * @param dueAfter Only return jobs which are due to be executed after the given date. Jobs without duedate are never returned using this parameter.
     * @param exceptionMessage Only return jobs with the given exception message
     * @param tenantId Only return jobs with the given tenantId.
     * @param tenantIdLike Only return jobs with a tenantId like the given value.
     * @param withoutTenantId If true, only returns jobs without a tenantId set. If false, the withoutTenantId parameter is ignored.
     * @param locked If true, only return jobs which are locked.  If false, this parameter is ignored.
     * @param unlocked If true, only return jobs which are unlocked. If false, this parameter is ignored.
     * @param sort Property to sort on, to be used together with the order.
     * @return DataResponseJobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public DataResponseJobResponse listDeadLetterJobs(String id, String processInstanceId, String executionId, String processDefinitionId, String elementId, String elementName, Boolean executable, Boolean timersOnly, Boolean messagesOnly, Boolean withException, OffsetDateTime dueBefore, OffsetDateTime dueAfter, String exceptionMessage, String tenantId, String tenantIdLike, Boolean withoutTenantId, Boolean locked, Boolean unlocked, String sort) throws RestClientException {
        Object postBody = null;

        String path = UriComponentsBuilder.fromPath("/management/deadletter-jobs").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", id));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processInstanceId", processInstanceId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executionId", executionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processDefinitionId", processDefinitionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementId", elementId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementName", elementName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executable", executable));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "timersOnly", timersOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "messagesOnly", messagesOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withException", withException));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueBefore", dueBefore));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueAfter", dueAfter));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "exceptionMessage", exceptionMessage));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantId", tenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantIdLike", tenantIdLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withoutTenantId", withoutTenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "locked", locked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "unlocked", unlocked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "sort", sort));

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<DataResponseJobResponse> returnType = new ParameterizedTypeReference<DataResponseJobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List jobs
     *
     * <p><b>200</b> - Indicates the requested jobs were returned.
     * <p><b>400</b> - Indicates an illegal value has been used in a url query parameter or the both &#39;messagesOnly&#39; and &#39;timersOnly&#39; are used as parameters. Status description contains additional details about the error.
     * @param id Only return job with the given id
     * @param processInstanceId Only return jobs part of a process with the given id
     * @param executionId Only return jobs part of an execution with the given id
     * @param processDefinitionId Only return jobs with the given process definition id
     * @param elementId Only return jobs with the given element id
     * @param elementName Only return jobs with the given element name
     * @param timersOnly If true, only return jobs which are timers. If false, this parameter is ignored. Cannot be used together with &#39;messagesOnly&#39;.
     * @param messagesOnly If true, only return jobs which are messages. If false, this parameter is ignored. Cannot be used together with &#39;timersOnly&#39;
     * @param withException If true, only return jobs for which an exception occurred while executing it. If false, this parameter is ignored.
     * @param dueBefore Only return jobs which are due to be executed before the given date. Jobs without duedate are never returned using this parameter.
     * @param dueAfter Only return jobs which are due to be executed after the given date. Jobs without duedate are never returned using this parameter.
     * @param exceptionMessage Only return jobs with the given exception message
     * @param tenantId Only return jobs with the given tenantId.
     * @param tenantIdLike Only return jobs with a tenantId like the given value.
     * @param withoutTenantId If true, only returns jobs without a tenantId set. If false, the withoutTenantId parameter is ignored.
     * @param locked If true, only return jobs which are locked.  If false, this parameter is ignored.
     * @param unlocked If true, only return jobs which are unlocked. If false, this parameter is ignored.
     * @param sort Property to sort on, to be used together with the order.
     * @return DataResponseJobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public DataResponseJobResponse listJobs(String id, String processInstanceId, String executionId, String processDefinitionId, String elementId, String elementName, Boolean timersOnly, Boolean messagesOnly, Boolean withException, OffsetDateTime dueBefore, OffsetDateTime dueAfter, String exceptionMessage, String tenantId, String tenantIdLike, Boolean withoutTenantId, Boolean locked, Boolean unlocked, String sort) throws RestClientException {
        Object postBody = null;

        String path = UriComponentsBuilder.fromPath("/management/jobs").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", id));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processInstanceId", processInstanceId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executionId", executionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processDefinitionId", processDefinitionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementId", elementId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementName", elementName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "timersOnly", timersOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "messagesOnly", messagesOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withException", withException));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueBefore", dueBefore));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueAfter", dueAfter));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "exceptionMessage", exceptionMessage));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantId", tenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantIdLike", tenantIdLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withoutTenantId", withoutTenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "locked", locked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "unlocked", unlocked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "sort", sort));

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<DataResponseJobResponse> returnType = new ParameterizedTypeReference<DataResponseJobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List suspended jobs
     *
     * <p><b>200</b> - Indicates the requested jobs were returned.
     * <p><b>400</b> - Indicates an illegal value has been used in a url query parameter or the both &#39;messagesOnly&#39; and &#39;timersOnly&#39; are used as parameters. Status description contains additional details about the error.
     * @param id Only return job with the given id
     * @param processInstanceId Only return jobs part of a process with the given id
     * @param executionId Only return jobs part of an execution with the given id
     * @param processDefinitionId Only return jobs with the given process definition id
     * @param elementId Only return jobs with the given element id
     * @param elementName Only return jobs with the given element name
     * @param executable If true, only return jobs which are executable. If false, this parameter is ignored.
     * @param timersOnly If true, only return jobs which are timers. If false, this parameter is ignored. Cannot be used together with &#39;messagesOnly&#39;.
     * @param messagesOnly If true, only return jobs which are messages. If false, this parameter is ignored. Cannot be used together with &#39;timersOnly&#39;
     * @param withException If true, only return jobs for which an exception occurred while executing it. If false, this parameter is ignored.
     * @param dueBefore Only return jobs which are due to be executed before the given date. Jobs without duedate are never returned using this parameter.
     * @param dueAfter Only return jobs which are due to be executed after the given date. Jobs without duedate are never returned using this parameter.
     * @param exceptionMessage Only return jobs with the given exception message
     * @param tenantId Only return jobs with the given tenantId.
     * @param tenantIdLike Only return jobs with a tenantId like the given value.
     * @param withoutTenantId If true, only returns jobs without a tenantId set. If false, the withoutTenantId parameter is ignored.
     * @param locked If true, only return jobs which are locked.  If false, this parameter is ignored.
     * @param unlocked If true, only return jobs which are unlocked. If false, this parameter is ignored.
     * @param sort Property to sort on, to be used together with the order.
     * @return DataResponseJobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public DataResponseJobResponse listSuspendedJobs(String id, String processInstanceId, String executionId, String processDefinitionId, String elementId, String elementName, Boolean executable, Boolean timersOnly, Boolean messagesOnly, Boolean withException, OffsetDateTime dueBefore, OffsetDateTime dueAfter, String exceptionMessage, String tenantId, String tenantIdLike, Boolean withoutTenantId, Boolean locked, Boolean unlocked, String sort) throws RestClientException {
        Object postBody = null;

        String path = UriComponentsBuilder.fromPath("/management/suspended-jobs").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", id));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processInstanceId", processInstanceId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executionId", executionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processDefinitionId", processDefinitionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementId", elementId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementName", elementName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executable", executable));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "timersOnly", timersOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "messagesOnly", messagesOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withException", withException));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueBefore", dueBefore));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueAfter", dueAfter));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "exceptionMessage", exceptionMessage));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantId", tenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantIdLike", tenantIdLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withoutTenantId", withoutTenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "locked", locked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "unlocked", unlocked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "sort", sort));

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<DataResponseJobResponse> returnType = new ParameterizedTypeReference<DataResponseJobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List timer jobs
     *
     * <p><b>200</b> - Indicates the requested jobs were returned.
     * <p><b>400</b> - Indicates an illegal value has been used in a url query parameter or the both &#39;messagesOnly&#39; and &#39;timersOnly&#39; are used as parameters. Status description contains additional details about the error.
     * @param id Only return job with the given id
     * @param processInstanceId Only return jobs part of a process with the given id
     * @param executionId Only return jobs part of an execution with the given id
     * @param processDefinitionId Only return jobs with the given process definition id
     * @param elementId Only return jobs with the given element id
     * @param elementName Only return jobs with the given element name
     * @param executable If true, only return jobs which are executable. If false, this parameter is ignored.
     * @param timersOnly If true, only return jobs which are timers. If false, this parameter is ignored. Cannot be used together with &#39;messagesOnly&#39;.
     * @param messagesOnly If true, only return jobs which are messages. If false, this parameter is ignored. Cannot be used together with &#39;timersOnly&#39;
     * @param withException If true, only return jobs for which an exception occurred while executing it. If false, this parameter is ignored.
     * @param dueBefore Only return jobs which are due to be executed before the given date. Jobs without duedate are never returned using this parameter.
     * @param dueAfter Only return jobs which are due to be executed after the given date. Jobs without duedate are never returned using this parameter.
     * @param exceptionMessage Only return jobs with the given exception message
     * @param tenantId Only return jobs with the given tenantId.
     * @param tenantIdLike Only return jobs with a tenantId like the given value.
     * @param withoutTenantId If true, only returns jobs without a tenantId set. If false, the withoutTenantId parameter is ignored.
     * @param locked If true, only return jobs which are locked.  If false, this parameter is ignored.
     * @param unlocked If true, only return jobs which are unlocked. If false, this parameter is ignored.
     * @param sort Property to sort on, to be used together with the order.
     * @return DataResponseJobResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public DataResponseJobResponse listTimerJobs(String id, String processInstanceId, String executionId, String processDefinitionId, String elementId, String elementName, Boolean executable, Boolean timersOnly, Boolean messagesOnly, Boolean withException, OffsetDateTime dueBefore, OffsetDateTime dueAfter, String exceptionMessage, String tenantId, String tenantIdLike, Boolean withoutTenantId, Boolean locked, Boolean unlocked, String sort) throws RestClientException {
        Object postBody = null;

        String path = UriComponentsBuilder.fromPath("/management/timer-jobs").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", id));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processInstanceId", processInstanceId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executionId", executionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "processDefinitionId", processDefinitionId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementId", elementId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "elementName", elementName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "executable", executable));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "timersOnly", timersOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "messagesOnly", messagesOnly));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withException", withException));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueBefore", dueBefore));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "dueAfter", dueAfter));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "exceptionMessage", exceptionMessage));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantId", tenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantIdLike", tenantIdLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "withoutTenantId", withoutTenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "locked", locked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "unlocked", unlocked));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "sort", sort));

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<DataResponseJobResponse> returnType = new ParameterizedTypeReference<DataResponseJobResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
}
